<?php

/** @var \Laravel\Lumen\Routing\Router $router */

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
//    phpinfo();
//    return $router->app->version();
    echo '啥也没有';
});
$router->group(['namespace' => 'Api'],function () use ($router){
    $router->get('/get_company_asin', 'HomeController@get_company_asin');
    $router->post('/get_asin_order_num', 'HomeController@get_asin_order_num');
    $router->post('/update_category_order', 'HomeController@update_category_order');
    $router->post('/update_wt_order_to_parent', 'HomeController@update_wt_order_to_parent');
    $router->post('/create_name', 'HomeController@create_name');
    $router->post('/update_group_name', 'HomeController@update_group_name');
    $router->post('/update_sj_name', 'HomeController@update_sj_name');
    $router->post('/copy_category', 'HomeController@copy_category');
    $router->post('/generate_category', 'HomeController@generate_category');
});

//Vben-admin后台接口
$router->group(['namespace' => 'Admin', 'prefix' => 'admin-api'],function () use ($router){
    $router->post('register', 'HomeController@register');
    $router->post('login', 'HomeController@login');
    $router->post('get_asin_order_num', 'HomeController@get_asin_order_num');
    $router->get('get_wt_group', 'HomeController@get_wt_group');
    $router->post('get_low_order', 'HomeController@get_low_order');

    //需要登录
    $router->group(['middleware' => 'user'], function () use ($router) {

        //用户
        $router->get('getUserInfo', 'UserController@getUserInfo');
        $router->get('getPermCode', 'UserController@getPermCode');
        $router->get('getMenuList', 'UserController@getMenuList');
        $router->get('logout', 'UserController@logout');
        $router->get('system/getAccountList', 'UserController@getAccountList');
        $router->get('system/getAllRoleList', 'UserController@getAllRoleList');
        $router->post('system/accountExist', 'UserController@accountExist');
        $router->post('system/createOrUpdateAccount', 'UserController@createOrUpdateAccount');
        $router->post('system/setAdminStatus', 'UserController@setAdminStatus');

        //角色
        $router->get('system/getRoleListByPage', 'RoleController@getRoleList');
        $router->post('system/setRoleStatus', 'RoleController@setRoleStatus');
        $router->post('system/createOrUpdateRole', 'RoleController@createOrUpdateRole');
        $router->delete('system/deleteRole', 'RoleController@deleteRole');

        //菜单
        $router->get('system/getMenuList', 'PermissionController@getAllMenu');
        $router->get('system/getMenuListTrue', 'PermissionController@getAllMenu');
        $router->post('system/createOrUpdateMenu', 'PermissionController@createOrUpdateMenu');
        $router->delete('system/deleteMenu', 'PermissionController@deleteMenu');

        //amazon分类
        $router->post('category/getCategoryInfo', 'CategoryController@getCategoryInfo');
        $router->post('category/getWtCategory', 'CategoryController@getWtCategory');
        $router->post('category/getWtGroupCategory', 'CategoryController@getWtGroupCategory');
        $router->post('category/getChildrenInfo', 'CategoryController@getChildrenInfo');
        $router->post('category/getCategoryProduct', 'CategoryController@getCategoryProduct');
        $router->post('category/getCategoryChildren', 'CategoryController@getCategoryChildren');
        $router->post('category/getCategoryGroupChildren', 'CategoryController@getCategoryGroupChildren');
        $router->post('category/createCategory', 'HomeController@create_category');

        //amazon产品
        $router->post('product/getAsinInfo', 'ProductController@getAsinInfo');
        $router->post('product/getProductInfo', 'ProductController@getProductInfo');
        $router->post('product/getGroupProductInfos', 'ProductController@getGroupProductInfo');
        $router->post('product/getProductByAsin', 'ProductController@getProductByAsin');
        $router->post('product/getProductDetail', 'ProductController@getProductDetail');
        $router->post('product/deleteProduct', 'ProductController@deleteProduct');
        $router->post('product/markProduct', 'ProductController@markProduct');
        $router->post('product/getProductLine', 'ProductController@getProductLine');
        $router->post('product/getGroupProductLine', 'ProductController@getGroupProductLine');
        $router->post('product/getProductBySjName', 'ProductController@getProductBySjName');
        $router->post('product/getProductBySjNameGroup', 'ProductController@getProductBySjNameGroup');
        $router->post('product/getDayAvgOrder', 'ProductController@getDayAvgOrder');
        $router->post('product/productLineTotalAnalyse', 'ProductController@productLineTotalAnalyse');
        $router->post('product/updateAsinOrder', 'ProductController@updateAsinOrder');
        $router->post('product/exportXls', 'ProductController@exportXls');

        //预生产数据中心
        $router->post('task/getTaskInfo', 'TaskController@getTaskInfo');
        $router->post('task/createTaskInfo', 'TaskController@createTaskInfo');
        $router->post('task/generate_category', 'HomeController@generate_category');
        $router->post('task/generate_order_asin', 'HomeController@generate_order_asin');
        $router->post('task/generate_order_product', 'HomeController@generate_order_product');
        $router->post('task/generate_sj_name', 'HomeController@generate_sj_name');
        $router->post('task/generate_python_sj', 'HomeController@generate_python_sj');
        $router->post('task/generate_order_num', 'HomeController@generate_order_num');
        $router->post('task/generate_low_order', 'HomeController@generate_low_order');
        $router->post('task/check_asin_is_limit', 'HomeController@check_asin_is_limit');
        $router->post('task/set_asin_limit', 'HomeController@set_asin_limit');
        $router->post('task/set_group_limit', 'HomeController@set_group_limit');
        $router->post('task/get_all_limit_type', 'HomeController@get_all_limit_type');
        $router->post('task/sync_asin_to_system', 'HomeController@sync_asin_to_system');

    });
});

